<!-- 个人中心 -->
<template>
    <view class="container">
      <view>
		  <view class="">
		  	<image style="width: 100%;" :src="detail.img_main" mode="widthFix"></image>
		  </view>
		  <view style="font-size: 32rpx;font-weight: 500;color: #333333;line-height: 50rpx;">
		  	{{detail.title==null?'':detail.title}}
		  </view>
		  <view style="font-size: 28rpx;color: #999999;line-height: 40rpx;">
		  	主讲导师：	{{detail.user_name==null?'':detail.user_name}}
		  </view>
			  <view style="font-size: 28rpx;color: #999999;line-height: 40rpx;">
		  	开课时间：	{{detail.star_time }}
		  </view>
			  <view style="font-size: 28rpx;color: #999999;line-height: 40rpx;">
		  	学士安排：	{{detail.arrange==null?'':detail.arrange}}
		  </view>
		  <view style="margin:10rpx  0 ;color: #F87878;padding:0 10px;line-height:44rpx;background: #FFF3F3;border-radius: 6px 6px 6px 6px;opacity: 1;">
		  	{{detail.introduce==null?'':detail.introduce}}
		  </view>
		  <view :style="detail.b_status !='1'?'':'background: #EEEEEE;color:#666666'" @click="goPage('/pages/jewel/signup?id=' + detail.id)" style="background-color: #DE2415;border-radius: 10rpx;line-height: 76rpx;color: #FFFFFF;margin-top: 20rpx;text-align: center;">
			  {{detail.b_status !='1'?'立即报名':'已报名'}}
		  </view>
		  <view style="font-size: 32rpx;font-weight: 500;color: #333333;line-height: 80rpx;border: 1px solid #EEEEEE;">
		  	课程概述
		  </view>
		 
		  <view style="margin:20rpx 0;" >
		  		<u-parse :html="detail.info" :tag-style="vuex_parse_style" :domain="'https://huboshizb.bigchun.com'"
		  		 @linkpress="diylinkpress"></u-parse>
		  </view>
	  </view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                detail:null,
				id:null
            }
        },
		filters:{
			dateFormat(time) {
							let date = new Date(time*1000);
							let year = date.getFullYear();
							// 在日期格式中，月份是从0开始的，因此要加0，使用三元表达式在小于10的前面加0，以达到格式统一  如 09:11:05
							let month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
							let day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
							let hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
							let minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
							let seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
							// 拼接
							// return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
							return year + "年" + month + "月" + day+"日";
			},
		},
        onLoad(options) {
			console.log(options);
			this.id=options.id;
			this.trainDetail()
        },
        onShow() {
			console.log('111111')
        },
        computed: {

        },
        methods: {
           trainDetail(){
			   this.$api.trainDetail({
			   	id  :this.id
			   }).then(res => {
			       console.log('trainDetail',res)
			       if(res.code ==1){
			          this.detail=res.data
			       }
			   });
		   }
        },
		onUnload() {
		}
    }
</script>

<style lang="scss" scoped>
	.container{
		margin: 20rpx;
	}
</style>
